<extend name="Layout:form" />
<block name="title"><title>角色编辑</title></block>
<block name="subnav">
    <a class="add fb" href="__MODULE__/Role/add"><em>添加角色</em></a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="__MODULE__/Role/index"><em>角色管理</em></a><span>|</span>
    <a class="" href="javascript:void(0);"><em>权限分配</em></a>
</block>
<block name="main">
    <form name="myform" id="myform" action="__MODULE__/Role/edit" method="post">
        <input name="id" type="hidden" value="<?php echo $id; ?>" />
        <table cellpadding=0 cellspacing=0 class="table_form" width="100%">
            <tr>
                <td width="10%" >角色名称</td>
                <td width="90%"><input type="text" class="input-text" name="info[name]" id="name" value="<?php echo $role['name']; ?>" size="40"/></td>
            </tr>
            <tr>
                <td width="10%" >描述</td>
                <td width="90%"><textarea name="remark" rows="4" cols="40"  id="info[remark]" /><?php echo $role['remark']; ?></textarea>
                </td>
            </tr>
            <tr>
                <td width="10%" >状态</td>
                <td width="90%">
                    <label style="float:left;width:75px">
                        <input type="radio" class="input_radio " name="info[status]" id="status_1" <?php if($role['status']==1){echo "checked";} ?> value="1"> 启用
                    </label>
                    <label style="float:left;width:75px">
                        <input type="radio" class="input_radio " name="info[status]" id="status_2" <?php if($role['status']==0){echo "checked";} ?>  value="0" > 禁用
                    </label>
                </td>
            </tr>
        </table>
        <div class="bk15"></div>
        <div class="btn">
            <input type="submit" name="dosubmit" id="dosubmit" value="提交" class='button'>&nbsp;<input type="reset" value="重置" class='button'>
        </div>
    </form>
</block>
<block name="footer">
<script type="text/javascript">
    $(function(){
        $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true}, function(){this.close();$(obj).focus();})}});
        $("#name").formValidator({onshow:"请输入角色名称",onfocus:"请输入角色名称",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入角色名称"}).defaultPassed();
        // .ajaxValidator({type:"get",url:"__CONTROLLER__/public_check_poster",data:"",datatype:"html",cached:false,async:'true',success : function(data) {if( data == "1" ) { return true; } else { return false; } }, error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");}, onerror : "该广告已存在", onwait : "正进行合法性校验..."});
    });
</script>
</block>